import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-07-08
 * Time: 18:37
 */
public class test6 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            double a = in.nextFloat();
            String b = in.next();
            int sum = 20;
            if (a <= 1) {
                if (b.equals("y")) {
                    sum += 5;
                    System.out.println(sum);
                } else {
                    System.out.println(sum);
                }
            }
            double aa = Math.ceil(a - 1);
            sum += aa*1;
            if (b.equals("y")) {
                sum += 5;
                System.out.println(sum);
            } else {
                System.out.println(sum);
            }
        }
    }
}
